package com.hcloud.libupload.request

import com.hcloud.libupload.callback.IPartSuccessCallback
import com.hcloud.libupload.callback.IProgressCallback
import com.hcloud.libupload.task.UploadTask

open class UploadRequest(
    var requestId: String = "",
    var filePath: String = "",
    var serverPath: String = "",
    var uploadTask: UploadTask? = null,
    var part : Int = 0
) {

    var isCancel = false


    fun setProgressCallback(iProgressCallback: IProgressCallback) {
        uploadTask?.setProgressCallback(iProgressCallback)
    }

    fun setPartSuccessCallback(iPartSuccessCallback: IPartSuccessCallback){
        uploadTask?.setPartSuccessCallback(iPartSuccessCallback)
    }

    fun cancel() {
        isCancel = true
        uploadTask?.taskControl?.cancel()
    }

}